package com.run2code.design.creational.factory;

import com.run2code.design.creational.factory.out.TencentCos;

import java.util.Map;

/**
 * 上传子类 cos，继承了抽象类，并且调用了上传至oss的方法
 * 关注公众号【奔跑的码畜】，一起进步不迷路
 *
 * @author 第七人格
 * @date 2023/11/15
 */
public class TencentUpDownloader extends BaseUpDownloader {

    private TencentCos tencentCos;

    public TencentUpDownloader() {
        this.tencentCos = new TencentCos();
    }

    @Override
    public String doUpload(String filePath, String fileName, Map<String, String> param) {
        String result = tencentCos.tencentUpload(fileName, param.get("base64"), param.get("appID"), param.get("appSecret"));
        System.out.println(result);
        return "TencentUpDownloader upload success";
    }
}